package com.ma.crawl_book.controller;

import com.ma.crawl_book.model.SectionBean;
import com.ma.crawl_book.model.SectionContent;
import com.ma.crawl_book.service.ISectionContentService;
import com.ma.crawl_book.service.SectionService;
import com.ma.crawl_book.service.impl.SectionContentServiceImpl;
import com.ma.crawl_book.service.impl.SectionServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class SectionController {

    @Autowired
    SectionService sectionService;

    @Resource
    ISectionContentService sectionContentService;

    public int insertSection(SectionBean sectionBean){
        sectionService.insertSection(sectionBean);
        return sectionBean.getId();
    }

    /**
     *
     * @param sectionContent
     */
    public void insertSectionContent(SectionContent sectionContent){
       sectionContentService.insertSectionContent(sectionContent);
    }
}
